]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Ensure chrome input region is updated after slide animation
authorSebastian Keller <skeller@gnome.org>
Tue, 17 Aug 2021 22:45:16 +0000 (00:45 +0200)
committerSebastian Keller <skeller@gnome.org>
Wed, 1 Sep 2021 16:37:56 +0000 (18:37 +0200)
The keyboard is placed outside of the screen when shown and then slides
in via a transition that changes the translate-y property. This
translation does not affect the allocation of the Keyboard actor and as
such does not trigger any of the signals LayoutManager is connected to
to update the input region. This means the input region remains at the
original position of the actor outside of the screen and as a result on
X11 clicks will go through to the underlying window.

There was a workaround for this by queuing a relayout at the end of the
transition, but this stopped working due to optimizations avoiding
unnecessary allocation changes.

This updates that workaround to toggle the visibility of the actor
instead, which is the other signal that LayoutManager reacts to. Once
ClutterActor provides better ways to react to transforms this can
hopefully be removed entirely.

Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4556
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1955>

js/ui/keyboard.js

index 0597e82e4a9f6ed5b4dd1e2c50e0e871c787ebd4..639a7427373f816cf7f88ad80253cd36643b365e 100644 (file)
@@ -1874,8 +1874,11 @@ var Keyboard = GObject.registerClass({
             this.translation_y = -this.height;
         });
 
-        // Queue a relayout so the keyboardBox can update its chrome region.
-        keyboardBox.queue_relayout();
+        // Toggle visibility so the keyboardBox can update its chrome region.
+        if (!Meta.is_wayland_compositor()) {
+            keyboardBox.hide();
+            keyboardBox.show();
+        }
     }
 
     _animateHide() {